home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9391 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.iadfw.net!usenet
  2. From: Larry Weiss <lfw@iadfw.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Tradition or what?
  5. Date: Sun, 10 Mar 1996 19:08:29 -0600
  6. Organization: ...
  7. Message-ID: <31437D0D.3D91@iadfw.net>
  8. References: <danpop.825961872@rscernix> <313C5CD1.1209@oc.com> <danpop.826211387@rscernix> <DnxB7J.G7r@cwi.nl>
  9. NNTP-Posting-Host: dal03-27.ppp.iadfw.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Dik T. Winter wrote:
  16.  > 
  17.  > Similar things do happen in integer code too.  Take binary search; you
  18.  > happen to divide by two a lot.  Change that to a macro?  What sensible
  19.  > name do you suggest; and what would be the result if you change the
  20.  > constant?  Moreover, the suggestion that using macro's makes changes
  21.  > easier and simpler to comprehend are *not* true.  They lead to the
  22.  > cases where code starts with:
  23.  >   #define THREE 4
  24.  > and in many cases it is not possible (in my opinion) to pick up more
  25.  > sensible names.
  26.  > 
  27.  > The rule as such is *not* good.  There are too many cases where the
  28.  > rule obscures the actual algorithm used.
  29.  
  30. Obviously from my previous postings, I agree with you.  
  31.  
  32. I'm looking forward to answers to your specific questions from those who would
  33. justify the elimination of all literal non-zero numeric constants outside
  34. a #define or enum context.  
  35.  
  36. I'm also still waiting for someone to take up my challenge to actually examine
  37. their sources and then report that they found no non-zero numeric literals,
  38. or that they were mistaken in the use of every one they discovered.
  39.